$(function(){
	$("input[name='btn']").on("click",function(){
		var data={};
		data.username=$("input[name='gh_name']").val();
		data.phone=$("input[name='gh_tel']").val();
		data.remark=$("textarea[name='gh_des']").val();
		data.domain=window.location.host;

		if(data.username==""){
			alert("请填写用户名");
			return;
		}	
		
		if(data.phone==""){
			alert("请填写手机号");
			return;
		}else{
			if(isNaN(data.phone)){
				alert("请填写正确的手机号");
				return;
			}else{
				if(data.phone.length!=11){
					alert("请输入正确的手机号");
					return;
				}
			}
		}

		$.getJSON("http://gh.120huamei.com/home/ghsubmitthree",data,function(response){
			if(response.result){
				alert(response.msg);
			}else{
				alert(response.msg);
			}
		})

	})
})
